package cn.hicard.risk.dao.sys.impl;

import org.springframework.stereotype.Repository;

import cn.hicard.risk.dao.BaseDao;
import cn.hicard.risk.dao.sys.DeptDao;
import cn.hicard.risk.entity.SysDept;

@Repository
public class DeptDaoImpl extends BaseDao<SysDept> implements DeptDao {

	@Override
	public void delete(Integer pkDept) throws Exception {
		super.delete(pkDept);
	}

	@Override
	public SysDept getByPk(Integer pkDept) throws Exception {
		return super.getByPk(pkDept);
	}

	@Override
	public boolean existsInUser(Integer pkDept) throws Exception {
		String hql = "SELECT COUNT(*) FROM MgUserinfo WHERE dept.pkDept=?";
		return super.findCountByHql(hql, pkDept)>0;
	}

}
